package com.cloud.shopping.job.dynamic;

import com.cloud.shopping.page.feign.SeckillPageFeign;
import com.cloud.shopping.spring.SpringContext;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

/**
 * @author John.zhang
 * @version Id: DynamicJob, v 1.0 2021/1/8 13:50 ZhiYong Exp $
 */
public class DynamicJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        //静态页删除
        delete(shardingContext.getJobParameter());
    }


    /***
     * 执行静态页删除
     */
    public void delete(String acid) {
        //从容器中获取指定的实例
        SeckillPageFeign seckillPageFeign = SpringContext.getBean(SeckillPageFeign.class);
        seckillPageFeign.deleteByAct(acid);
    }
}
